<?php


namespace App;


use TencentCloud\Common\Credential;
use TencentCloud\Common\Profile\ClientProfile;
use TencentCloud\Common\Profile\HttpProfile;
use TencentCloud\Vod\V20180717\VodClient;

class TenxunCloud
{
    public static function getClient()
    {
        // 实例化一个证书对象，入参需要传入腾讯云账户secretId，secretKey
        $cred = new Credential(Conf::get('tenxxun.accessKey'), Conf::get('tenxxun.secretKey'));
        // 实例化一个http选项，可选的，没有特殊需求可以跳过
        $httpProfile = new HttpProfile();
        $httpProfile->setReqMethod("GET");  // post请求(默认为post请求)
        $httpProfile->setReqTimeout(30);    // 请求超时时间，单位为秒(默认60秒)
        $httpProfile->setEndpoint("vod.ap-shanghai.tencentcloudapi.com");  // 指定接入地域域名(默认就近接入)

        $clientProfile = new ClientProfile();
        $clientProfile->setSignMethod("TC3-HMAC-SHA256");  // 指定签名算法(默认为HmacSHA256)
        $clientProfile->setHttpProfile($httpProfile);
        $client = new VodClient($cred, "ap-shanghai", $clientProfile);
        return $client;
    }
}